#include <stdio.h>
void sanjiao(int n)
{
	int arr[30][30] = { 1 };
	int i, j;
	for (i = 0; i < n; i++)
	{
		arr[i][0] = 1;
		for (j = 1; j <= i; j++)
		{
			arr[i][j] = arr[i-1][j ] + arr[i - 1][j - 1];
		}
	}
	for (i = 0; i < n; i++)
	{
		for (j = 0; j <= i; j++)
		{
			printf("%d ", arr[i][j]);
		}
		printf("\n");
	}
}
int main()
{
	int a = 0;
	scanf_s("%d", &a);
	sanjiao(a);
	return 0;
}